<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\reservation\validate;

use think\Validate;

/**
 * 预约列表验证器
 */
class reservationValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'reservation_id' => 'require',
        'lang_code' => 'require',
        'project_id' => 'require',
        'reservation_time_slot' => 'require',
        'reservation_person' => 'require',
        'phone_number' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'reservation_id'=>'请填写预约id',
        'project_id' => '请填写项目信息',
        'lang_code' => '语言代码，如zh-CN、en-US等必须填写',
        'project_id' => '预约项目标题必须填写',
        'reservation_time_slot' => '预约时段必须填写',
        'reservation_person' => '预约人必须填写',
        'phone_number' => '手机号必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'lang_code',
            'project_id',
            'reservation_time_slot',
            'reservation_person',
            'phone_number',
        ],
        'update' => [
            'reservation_id',
            'lang_code',
            'project_id',
            'reservation_time_slot',
            'reservation_person',
            'phone_number',
        ],
    ];

}
